/*   1:    */ package yahoofinance.quotes.stock;
/*   2:    */ 
/*   3:    */ import java.math.BigDecimal;
/*   4:    */ import java.util.Calendar;
/*   5:    */ import yahoofinance.Utils;
/*   6:    */ 
/*   7:    */ public class StockQuote
/*   8:    */ {
/*   9:    */   private final String symbol;
/*  10:    */   private BigDecimal ask;
/*  11:    */   private int askSize;
/*  12:    */   private BigDecimal bid;
/*  13:    */   private int bidSize;
/*  14:    */   private BigDecimal price;
/*  15:    */   private int lastTradeSize;
/*  16:    */   private Calendar lastTradeTime;
/*  17:    */   private BigDecimal open;
/*  18:    */   private BigDecimal previousClose;
/*  19:    */   private BigDecimal dayLow;
/*  20:    */   private BigDecimal dayHigh;
/*  21:    */   private BigDecimal yearLow;
/*  22:    */   private BigDecimal yearHigh;
/*  23:    */   private BigDecimal priceAvg50;
/*  24:    */   private BigDecimal priceAvg200;
/*  25:    */   private long volume;
/*  26:    */   private long avgVolume;
/*  27:    */   
/*  28:    */   public StockQuote(String symbol)
/*  29:    */   {
/*  30: 38 */     this.symbol = symbol;
/*  31:    */   }
/*  32:    */   
/*  33:    */   public BigDecimal getChange()
/*  34:    */   {
/*  35: 46 */     return this.price.subtract(this.previousClose);
/*  36:    */   }
/*  37:    */   
/*  38:    */   public BigDecimal getChangeInPercent()
/*  39:    */   {
/*  40: 54 */     return Utils.getPercent(getChange(), this.previousClose);
/*  41:    */   }
/*  42:    */   
/*  43:    */   public BigDecimal getChangeFromYearLow()
/*  44:    */   {
/*  45: 62 */     return this.price.subtract(this.yearLow);
/*  46:    */   }
/*  47:    */   
/*  48:    */   public BigDecimal getChangeFromYearLowInPercent()
/*  49:    */   {
/*  50: 70 */     return Utils.getPercent(getChangeFromYearLow(), this.yearLow);
/*  51:    */   }
/*  52:    */   
/*  53:    */   public BigDecimal getChangeFromYearHigh()
/*  54:    */   {
/*  55: 78 */     return this.price.subtract(this.yearHigh);
/*  56:    */   }
/*  57:    */   
/*  58:    */   public BigDecimal getChangeFromYearHighInPercent()
/*  59:    */   {
/*  60: 86 */     return Utils.getPercent(getChangeFromYearHigh(), this.yearHigh);
/*  61:    */   }
/*  62:    */   
/*  63:    */   public BigDecimal getChangeFromAvg50()
/*  64:    */   {
/*  65: 94 */     return this.price.subtract(this.priceAvg50);
/*  66:    */   }
/*  67:    */   
/*  68:    */   public BigDecimal getChangeFromAvg50InPercent()
/*  69:    */   {
/*  70:102 */     return Utils.getPercent(getChangeFromAvg50(), this.priceAvg50);
/*  71:    */   }
/*  72:    */   
/*  73:    */   public BigDecimal getChangeFromAvg200()
/*  74:    */   {
/*  75:110 */     return this.price.subtract(this.priceAvg200);
/*  76:    */   }
/*  77:    */   
/*  78:    */   public BigDecimal getChangeFromAvg200InPercent()
/*  79:    */   {
/*  80:118 */     return Utils.getPercent(getChangeFromAvg200(), this.priceAvg200);
/*  81:    */   }
/*  82:    */   
/*  83:    */   public String getSymbol()
/*  84:    */   {
/*  85:122 */     return this.symbol;
/*  86:    */   }
/*  87:    */   
/*  88:    */   public BigDecimal getAsk()
/*  89:    */   {
/*  90:126 */     return this.ask;
/*  91:    */   }
/*  92:    */   
/*  93:    */   public void setAsk(BigDecimal ask)
/*  94:    */   {
/*  95:130 */     this.ask = ask;
/*  96:    */   }
/*  97:    */   
/*  98:    */   public int getAskSize()
/*  99:    */   {
/* 100:134 */     return this.askSize;
/* 101:    */   }
/* 102:    */   
/* 103:    */   public void setAskSize(int askSize)
/* 104:    */   {
/* 105:138 */     this.askSize = askSize;
/* 106:    */   }
/* 107:    */   
/* 108:    */   public BigDecimal getBid()
/* 109:    */   {
/* 110:142 */     return this.bid;
/* 111:    */   }
/* 112:    */   
/* 113:    */   public void setBid(BigDecimal bid)
/* 114:    */   {
/* 115:146 */     this.bid = bid;
/* 116:    */   }
/* 117:    */   
/* 118:    */   public int getBidSize()
/* 119:    */   {
/* 120:150 */     return this.bidSize;
/* 121:    */   }
/* 122:    */   
/* 123:    */   public void setBidSize(int bidSize)
/* 124:    */   {
/* 125:154 */     this.bidSize = bidSize;
/* 126:    */   }
/* 127:    */   
/* 128:    */   public BigDecimal getPrice()
/* 129:    */   {
/* 130:158 */     return this.price;
/* 131:    */   }
/* 132:    */   
/* 133:    */   public void setPrice(BigDecimal price)
/* 134:    */   {
/* 135:162 */     this.price = price;
/* 136:    */   }
/* 137:    */   
/* 138:    */   public int getLastTradeSize()
/* 139:    */   {
/* 140:166 */     return this.lastTradeSize;
/* 141:    */   }
/* 142:    */   
/* 143:    */   public void setLastTradeSize(int lastTradeSize)
/* 144:    */   {
/* 145:170 */     this.lastTradeSize = lastTradeSize;
/* 146:    */   }
/* 147:    */   
/* 148:    */   public Calendar getLastTradeTime()
/* 149:    */   {
/* 150:174 */     return this.lastTradeTime;
/* 151:    */   }
/* 152:    */   
/* 153:    */   public void setLastTradeTime(Calendar lastTradeTime)
/* 154:    */   {
/* 155:178 */     this.lastTradeTime = lastTradeTime;
/* 156:    */   }
/* 157:    */   
/* 158:    */   public BigDecimal getOpen()
/* 159:    */   {
/* 160:182 */     return this.open;
/* 161:    */   }
/* 162:    */   
/* 163:    */   public void setOpen(BigDecimal open)
/* 164:    */   {
/* 165:186 */     this.open = open;
/* 166:    */   }
/* 167:    */   
/* 168:    */   public BigDecimal getPreviousClose()
/* 169:    */   {
/* 170:190 */     return this.previousClose;
/* 171:    */   }
/* 172:    */   
/* 173:    */   public void setPreviousClose(BigDecimal previousClose)
/* 174:    */   {
/* 175:194 */     this.previousClose = previousClose;
/* 176:    */   }
/* 177:    */   
/* 178:    */   public BigDecimal getDayLow()
/* 179:    */   {
/* 180:198 */     return this.dayLow;
/* 181:    */   }
/* 182:    */   
/* 183:    */   public void setDayLow(BigDecimal dayLow)
/* 184:    */   {
/* 185:202 */     this.dayLow = dayLow;
/* 186:    */   }
/* 187:    */   
/* 188:    */   public BigDecimal getDayHigh()
/* 189:    */   {
/* 190:206 */     return this.dayHigh;
/* 191:    */   }
/* 192:    */   
/* 193:    */   public void setDayHigh(BigDecimal dayHigh)
/* 194:    */   {
/* 195:210 */     this.dayHigh = dayHigh;
/* 196:    */   }
/* 197:    */   
/* 198:    */   public BigDecimal getYearLow()
/* 199:    */   {
/* 200:214 */     return this.yearLow;
/* 201:    */   }
/* 202:    */   
/* 203:    */   public void setYearLow(BigDecimal yearLow)
/* 204:    */   {
/* 205:218 */     this.yearLow = yearLow;
/* 206:    */   }
/* 207:    */   
/* 208:    */   public BigDecimal getYearHigh()
/* 209:    */   {
/* 210:222 */     return this.yearHigh;
/* 211:    */   }
/* 212:    */   
/* 213:    */   public void setYearHigh(BigDecimal yearHigh)
/* 214:    */   {
/* 215:226 */     this.yearHigh = yearHigh;
/* 216:    */   }
/* 217:    */   
/* 218:    */   public BigDecimal getPriceAvg50()
/* 219:    */   {
/* 220:234 */     return this.priceAvg50;
/* 221:    */   }
/* 222:    */   
/* 223:    */   public void setPriceAvg50(BigDecimal priceAvg50)
/* 224:    */   {
/* 225:238 */     this.priceAvg50 = priceAvg50;
/* 226:    */   }
/* 227:    */   
/* 228:    */   public BigDecimal getPriceAvg200()
/* 229:    */   {
/* 230:246 */     return this.priceAvg200;
/* 231:    */   }
/* 232:    */   
/* 233:    */   public void setPriceAvg200(BigDecimal priceAvg200)
/* 234:    */   {
/* 235:250 */     this.priceAvg200 = priceAvg200;
/* 236:    */   }
/* 237:    */   
/* 238:    */   public long getVolume()
/* 239:    */   {
/* 240:254 */     return this.volume;
/* 241:    */   }
/* 242:    */   
/* 243:    */   public void setVolume(long volume)
/* 244:    */   {
/* 245:258 */     this.volume = volume;
/* 246:    */   }
/* 247:    */   
/* 248:    */   public long getAvgVolume()
/* 249:    */   {
/* 250:262 */     return this.avgVolume;
/* 251:    */   }
/* 252:    */   
/* 253:    */   public void setAvgVolume(long avgVolume)
/* 254:    */   {
/* 255:266 */     this.avgVolume = avgVolume;
/* 256:    */   }
/* 257:    */   
/* 258:    */   public String toString()
/* 259:    */   {
/* 260:271 */     return "Ask: " + this.ask + ", Bid: " + this.bid + ", Price: " + this.price + ", Prev close: " + this.previousClose;
/* 261:    */   }
/* 262:    */ }


/* Location:           C:\Users\zhi min\Desktop\YahooFinanceAPI-1.3.0\
 * Qualified Name:     yahoofinance.quotes.stock.StockQuote
 * JD-Core Version:    0.7.0.1
 */